package com.explorati.design_pattern.creational.builder.example;

/**
 * 导演者Director起到封装作用，避免高层模块深入到建造者内部的实现类
 * 
 * @author explorati
 *
 */
public class Director {

	private Builder builder;

	public void setProductBuilder(Builder builder) {
		this.builder = builder;
	}

	public Product produceProduct(String productName, String produceDate, String usingInstruction) {
		this.builder.buildName(productName);
		this.builder.buildDate(produceDate);
		this.builder.buildInstruction(usingInstruction);

		return builder.produceProduct();
	}

	// public Product buildProduct() {
	// return builder.produceProduct();
	// }
}
